home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / compress / gnucpio.zip / CPIO.INF (.txt) < prev    next >
GNU Info File  |  1995-12-20  |  18KB  |  364 lines

  1. This is Info file cpio.info, produced by Makeinfo-1.55 from the input
  2. file cpio.texi.
  3. START-INFO-DIR-ENTRY
  4. * cpio: (cpio).                 Making tape (or disk) archives.
  5. END-INFO-DIR-ENTRY
  6.    This file documents GNU cpio 2.4.
  7.    Copyright (C) 1995 Free Software Foundation, Inc.
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.    Permission is granted to copy and distribute modified versions of
  12. this manual under the conditions for verbatim copying, provided that
  13. the entire resulting derived work is distributed under the terms of a
  14. permission notice identical to this one.
  15.    Permission is granted to copy and distribute translations of this
  16. manual into another language, under the above conditions for modified
  17. versions, except that this permission notice may be stated in a
  18. translation approved by the Foundation.
  19. File: cpio.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
  20.    GNU cpio is a tool for creating and extracting archives, or copying
  21. files from one place to another.  It handles a number of cpio formats as
  22. well as reading and writing tar files.  This is the first edition of the
  23. GNU cpio documentation and is consistant with GNU cpio 2.4.
  24. * Menu:
  25. * Introduction::
  26. * Tutorial::                    Getting started.
  27. * Invoking `cpio'::             How to invoke `cpio'.
  28. * Media::                       Using tapes and other archive media.
  29. * Concept Index::               Concept index.
  30.  -- The Detailed Node Listing --
  31. Invoking cpio
  32. * Copy-out mode::
  33. * Copy-in mode::
  34. * Copy-pass mode::
  35. * Options::
  36. File: cpio.info,  Node: Introduction,  Next: Tutorial,  Prev: Top,  Up: Top
  37. Introduction
  38. ************
  39.    GNU cpio copies files into or out of a cpio or tar archive, The
  40. archive can be another file on the disk, a magnetic tape, or a pipe.
  41.    GNU cpio supports the following archive formats: binary, old ASCII,
  42. new ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar.
  43. The tar format is provided for compatability with the tar program. By
  44. default, cpio creates binary format archives, for compatibility with
  45. older cpio programs.  When extracting from archives, cpio automatically
  46. recognizes which kind of archive it is reading and can read archives
  47. created on machines with a different byte-order.
  48. File: cpio.info,  Node: Tutorial,  Next: Invoking `cpio',  Prev: Introduction,  Up: Top
  49. Tutorial
  50. ********
  51.    GNU cpio performs three primary functions.  Copying files to an
  52. archive, Extracting files from an archive, and passing files to another
  53. directory tree.  An archive can be a file on disk, one or more floppy
  54. disks, or one or more tapes.
  55.    When creating an archive, cpio takes the list of files to be
  56. processed from the standard input, and then sends the archive to the
  57. standard output, or to the device defined by the `-F' option.  *Note
  58. Copy-out mode::.  Usually find or ls is used to provide this list to
  59. the standard input.  In the following example you can see the
  60. possibilities for archiving the contents of a single directory.
  61.      % ls | cpio -ov > directory.cpio
  62.    The `-o' option creates the archive, and the `-v' option prints the
  63. names of the files archived as they are added.  Notice that the options
  64. can be put together after a single `-' or can be placed separately on
  65. the command line.  The `>' redirects the cpio output to the file
  66. `directory.cpio'.
  67.    If you wanted to archive an entire directory tree, the find command
  68. can provide the file list to cpio:
  69.      % find . -print -depth | cpio -ov > tree.cpio
  70.    This will take all the files in the current directory, the
  71. directories below and place them in the archive tree.cpio.  Again the
  72. `-o' creates an archive, and the `-v' option shows you the name of the
  73. files as they are archived.  *Note Copy-out mode::.  Using the `.' in
  74. the find statement will give you more flexibility when doing restores,
  75. as it will save file names with a relative path vice a hard wired,
  76. absolute path.  The `-depth' option forces `find' to print of the
  77. entries in a directory before printing the directory itself.  This
  78. limits the effects of restrictive directory permissions by printing the
  79. directory entries in a directory before the directory name itself.
  80.    Extracting an archive requires a bit more thought because cpio will
  81. not create directories by default.  Another characteristic, is it will
  82. not overwrite existing files unless you tell it to.
  83.      % cpio -iv < directory.cpio
  84.    This will retrieve the files archived in the file directory.cpio and
  85. place them in the present directory.  The `-i' option extracts the
  86. archive and the `-v' shows the file names as they are extracted.  If
  87. you are dealing with an archived directory tree, you need to use the
  88. `-d' option to create directories as necessary, something like:
  89.      % cpio -idv < tree.cpio
  90.    This will take the contents of the archive tree.cpio and extract it
  91. to the current directory.  If you try to extract the files on top of
  92. files of the same name that already exist (and have the same or later
  93. modification time) cpio will not extract the file unless told to do so
  94. by the -u option.  *Note Copy-in mode::.
  95.    In copy-pass mode, cpio copies files from one directory tree to
  96. another, combining the copy-out and copy-in steps without actually
  97. using an archive.  It reads the list of files to copy from the standard
  98. input; the directory into which it will copy them is given as a
  99. non-option argument.  *Note Copy-pass mode::.
  100.      % find . -depth -print0 | cpio --null -pvd new-dir
  101.    The example shows copying the files of the present directory, and
  102. sub-directories to a new directory called new-dir.  Some new options are
  103. the `-print0' available with GNU find, combined with the `--null'
  104. option of cpio.  These two options act together to send file names
  105. between find and cpio, even if special characters are embedded in the
  106. file names.  Another is `-p', which tells cpio to pass the files it
  107. finds to the directory `new-dir'.
  108. File: cpio.info,  Node: Invoking `cpio',  Next: Media,  Prev: Tutorial,  Up: Top
  109. Invoking cpio
  110. *************
  111. * Menu:
  112. * Copy-out mode::
  113. * Copy-in mode::
  114. * Copy-pass mode::
  115. * Options::
  116. File: cpio.info,  Node: Copy-out mode,  Next: Copy-in mode,  Prev: Invoking `cpio',  Up: Invoking `cpio'
  117. Copy-out mode
  118. =============
  119.    In copy-out mode, cpio copies files into an archive.  It reads a list
  120. of filenames, one per line, on the standard input, and writes the
  121. archive onto the standard output.  A typical way to generate the list
  122. of filenames is with the find command; you should give find the -depth
  123. option to minimize problems with permissions on directories that are
  124. unreadable.  *Note Options::.
  125.      cpio {-o|--create} [-0acvABLV] [-C bytes] [-H format]
  126.      [-M message] [-O [[user@]host:]archive] [-F [[user@]host:]archive]
  127.      [--file=[[user@]host:]archive] [--format=format] [--sparse]
  128.      [--message=message][--null] [--reset-access-time] [--verbose]
  129.      [--dot] [--append] [--block-size=blocks] [--dereference]
  130.      [--io-size=bytes] [--help] [--version] < name-list [> archive]
  131. File: cpio.info,  Node: Copy-in mode,  Next: Copy-pass mode,  Prev: Copy-out mode,  Up: Invoking `cpio'
  132. Copy-in mode
  133. ============
  134.    In copy-in mode, cpio copies files out of an archive or lists the
  135. archive contents.  It reads the archive from the standard input.  Any
  136. non-option command line arguments are shell globbing patterns; only
  137. files in the archive whose names match one or more of those patterns are
  138. copied from the archive.  Unlike in the shell, an initial `.' in a
  139. filename does match a wildcard at the start of a pattern, and a `/' in a
  140. filename can match wildcards.  If no patterns are given, all files are
  141. extracted.  *Note Options::.
  142.      cpio {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file]
  143.      [-H format] [-M message] [-R [user][:.][group]]
  144.      [-I [[user@]host:]archive] [-F [[user@]host:]archive]
  145.      [--file=[[user@]host:]archive] [--make-directories]
  146.      [--nonmatching] [--preserve-modification-time]
  147.      [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap]
  148.      [--dot] [--unconditional] [--verbose] [--block-size=blocks]
  149.      [--swap-halfwords] [--io-size=bytes] [--pattern-file=file]
  150.      [--format=format] [--owner=[user][:.][group]]
  151.      [--no- preserve-owner] [--message=message] [--help] [--version]
  152.      [-no-abosolute-filenames] [-only-verify-crc] [-quiet]
  153.      [pattern...] [< archive]
  154. File: cpio.info,  Node: Copy-pass mode,  Next: Options,  Prev: Copy-in mode,  Up: Invoking `cpio'
  155. Copy-pass mode
  156. ==============
  157.    In copy-pass mode, cpio copies files from one directory tree to
  158. another, combining the copy-out and copy-in steps without actually
  159. using an archive.  It reads the list of files to copy from the standard
  160. input; the directory into which it will copy them is given as a
  161. non-option argument.  *Note Options::.
  162.      cpio {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]
  163.      [--null] [--reset-access-time] [--make-directories] [--link]
  164.      [--preserve-modification-time] [--unconditional] [--verbose]
  165.      [--dot] [--dereference] [--owner=[user][:.][group]] [--sparse]
  166.      [--no-preserve-owner] [--help] [--version] destination-directory
  167.      < name-list
  168. File: cpio.info,  Node: Options,  Prev: Copy-pass mode,  Up: Invoking `cpio'
  169. Options
  170. =======
  171. `-0, --null'
  172.      Read a list of filenames terminated by a null character, instead
  173.      of a newline, so that files whose names contain newlines can be
  174.      archived.  GNU find is one way to produce a list of
  175.      null-terminated filenames.  This option may be used in copy-out
  176.      and copy-pass modes.
  177. `-a, --reset-access-time'
  178.      Reset the access times of files after reading them, so that it
  179.      does not look like they have just been read.
  180. `-A, --append'
  181.      Append to an existing archive.  Only works in copy-out mode.  The
  182.      archive must be a disk file specified with the -O or -F (-file)
  183.      option.
  184. `-b, --swap'
  185.      Swap both halfwords of words and bytes of halfwords in the data.
  186.      Equivalent to -sS.  This option may be used in copy-in mode.  Use
  187.      this option to convert 32-bit integers between big-endian and
  188.      little-endian machines.
  189.      Set the I/O block size to 5120 bytes.  Initially the block size is
  190.      512 bytes.
  191. `--block-size=BLOCK-SIZE'
  192.      Set the I/O block size to BLOCK-SIZE * 512 bytes.
  193.      Use the old portable (ASCII) archive format.
  194. `-C IO-SIZE, --io-size=IO-SIZE'
  195.      Set the I/O block size to IO-SIZE bytes.
  196. `-d, --make-directories'
  197.      Create leading directories where needed.
  198. `-E FILE, --pattern-file=FILE'
  199.      Read additional patterns specifying filenames to extract or list
  200.      from FILE.  The lines of FILE are treated as if they had been
  201.      non-option arguments to cpio.  This option is used in copy-in mode,
  202. `-f, --nonmatching'
  203.      Only copy files that do not match any of the given patterns.
  204. `-F, --file=archive'
  205.      Archive filename to use instead of standard input or output.  To
  206.      use a tape drive on another machine as the archive, use a filename
  207.      that starts with `HOSTNAME:'.  The hostname can be preceded by a
  208.      username and an `@' to access the remote tape drive as that user,
  209.      if you have permission to do so (typically an entry in that user's
  210.      `~/.rhosts' file).
  211. `--force-local'
  212.      With -F, -I, or -O, take the archive file name to be a local file
  213.      even if it contains a colon, which would ordinarily indicate a
  214.      remote host name.
  215. `-H FORMAT, --format=FORMAT'
  216.      Use archive format FORMAT.  The valid formats are listed below;
  217.      the same names are also recognized in all-caps.  The default in
  218.      copy-in mode is to automatically detect the archive format, and in
  219.      copy-out mode is `bin'.
  220.     `bin'
  221.           The obsolete binary format.
  222.     `odc'
  223.           The old (POSIX.1) portable format.
  224.     `newc'
  225.           The new (SVR4) portable format, which supports file systems
  226.           having more than 65536 i-nodes.
  227.     `crc'
  228.           The new (SVR4) portable format with a checksum added.
  229.     `tar'
  230.           The old tar format.
  231.     `ustar'
  232.           The POSIX.1 tar format.  Also recognizes GNU tar archives,
  233.           which are similar but not identical.
  234.     `hpbin'
  235.           The obsolete binary format used by HPUX's cpio (which stores
  236.           device files differently).
  237.     `hpodc'
  238.           The portable format used by HPUX's cpio (which stores device
  239.           files differently).
  240. `-i, --extract'
  241.      Run in copy-in mode.  *Note Copy-in mode::.
  242. `-I archive'
  243.      Archive filename to use instead of standard input.  To use a tape
  244.      drive on another machine as the archive, use a filename that
  245.      starts with `HOSTNAME:'.  The hostname can be preceded by a
  246.      username and an `@' to access the remote tape drive as that user,
  247.      if you have permission to do so (typically an entry in that user's
  248.      `~/.rhosts' file).
  249.      Ignored; for compatibility with other versions of cpio.
  250. `-l, --link'
  251.      Link files instead of copying them, when possible.
  252. `-L, --dereference'
  253.      Copy the file that a symbolic link points to, rather than the
  254.      symbolic link itself.
  255. `-m, --preserve-modification-time'
  256.      Retain previous file modification times when creating files.
  257. `-M MESSAGE, --message=MESSAGE'
  258.      Print MESSAGE when the end of a volume of the backup media (such
  259.      as a tape or a floppy disk) is reached, to prompt the user to
  260.      insert a new volume.  If MESSAGE contains the string "%d", it is
  261.      replaced by the current volume number (starting at 1).
  262. `-n, --numeric-uid-gid'
  263.      Show numeric UID and GID instead of translating them into names
  264.      when using the `--verbose option'.
  265. `--no-absolute-filenames'
  266.      Create all files relative to the current directory in copy-in
  267.      mode, even if they have an absolute file name in the archive.
  268. `--no-preserve-owner'
  269.      Do not change the ownership of the files; leave them owned by the
  270.      user extracting them.  This is the default for non-root users, so
  271.      that users on System V don't inadvertantly give away files.  This
  272.      option can be used in copy-in mode and copy-pass mode
  273. `-o, --create'
  274.      Run in copy-out mode.  *Note Copy-out mode::.
  275. `-O archive'
  276.      Archive filename to use instead of standard output.  To use a tape
  277.      drive on another machine as the archive, use a filename that
  278.      starts with `HOSTNAME:'.  The hostname can be preceded by a
  279.      username and an `@' to access the remote tape drive as that user,
  280.      if you have permission to do so (typically an entry in that user's
  281.      `~/.rhosts' file).
  282. `--only-verify-crc'
  283.      Verify the CRC's of each file in the archive, when reading a CRC
  284.      format archive. Don't actually extract the files.
  285. `-p, --pass-through'
  286.      Run in copy-pass mode.  *Note Copy-pass mode::.
  287. `--quiet'
  288.      Do not print the number of blocks copied.
  289. `-r, --rename'
  290.      Interactively rename files.
  291. `-R [user][:.][group], --owner [user][:.][group]'
  292.      Set the ownership of all files created to the specified user and/or
  293.      group in copy-out and copy-pass modes.  Either the user, the
  294.      group, or both, must be present.  If the group is omitted but the
  295.      ":" or "." separator is given, use the given user's login group.
  296.      Only the super-user can change files' ownership.
  297. `-s, --swap-bytes'
  298.      Swap the bytes of each halfword (pair of bytes) in the files.This
  299.      option can be used in copy-in mode.
  300. `-S, --swap-halfwords'
  301.      Swap the halfwords of each word (4 bytes) in the files.  This
  302.      option may be used in copy-in mode.
  303. `--sparse'
  304.      Write files with large blocks of zeros as sparse files.  This
  305.      option is used in copy-out and copy-pass modes.
  306. `-t, --list'
  307.      Print a table of contents of the input.
  308. `-u, --unconditional'
  309.      Replace all files, without asking whether to replace existing
  310.      newer files with older files.
  311. `-v, --verbose'
  312.      List the files processed, or with `-t', give an `ls -l' style
  313.      table of contents listing.  In a verbose table of contents of a
  314.      ustar archive, user and group names in the archive that do not
  315.      exist on the local system are replaced by the names that
  316.      correspond locally to the numeric UID and GID stored in the
  317.      archive.
  318. `-V --dot'
  319.      Print a `.' for each file processed.
  320. `--version'
  321.      Print the cpio program version number and exit.
  322. File: cpio.info,  Node: Media,  Next: Concept Index,  Prev: Invoking `cpio',  Up: Top
  323. Magnetic Media
  324. **************
  325.    Archives are usually written on removable media-tape cartridges, mag
  326. tapes, or floppy disks.
  327.    The amount of data a tape or disk holds depends not only on its size,
  328. but also on how it is formatted.  A 2400 foot long reel of mag tape
  329. holds 40 megabytes of data when formated at 1600 bits per inch.  The
  330. physically smaller EXABYTE tape cartridge holds 2.3 gigabytes.
  331.    Magnetic media are re-usable-once the archive on a tape is no longer
  332. needed, the archive can be erased and the tape or disk used over. Media
  333. quality does deteriorate with use, however.  Most tapes or disks should
  334. be disgarded when they begin to produce data errors.
  335.    Magnetic media are written and erased using magnetic fields, and
  336. should be protected from such fields to avoid damage to stored data.
  337. Sticking a floppy disk to a filing cabinet using a magnet is probably
  338. not a good idea.
  339. File: cpio.info,  Node: Concept Index,  Prev: Media,  Up: Top
  340. Concept Index
  341. *************
  342. * Menu:
  343. * command line options:                 Invoking `cpio'.
  344. * copying directory structures:         Tutorial.
  345. * creating a cpio archive:              Tutorial.
  346. * extracting a cpio archive:            Tutorial.
  347. * invoking cpio:                        Invoking `cpio'.
  348. * magnetic media:                       Media.
  349. * passing directory structures:         Tutorial.
  350. Tag Table:
  351. Node: Top
  352. Node: Introduction
  353. Node: Tutorial
  354. Node: Invoking `cpio'
  355. Node: Copy-out mode
  356. Node: Copy-in mode
  357. Node: Copy-pass mode
  358. Node: Options
  359. Node: Media
  360. 16451
  361. Node: Concept Index
  362. 17437
  363. End Tag Table
  364.